package net.uhuijia.user.useridcard.service.impl;

import net.uhuijia.user.useridcard.service.UserIdCardService;
import net.uhuijia.user.usermall.persistence.model.UserMall;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import net.uhuijia.appbase.service.CrudService;
import net.uhuijia.user.useridcard.persistence.dao.UserIdCardDao;
import net.uhuijia.user.useridcard.persistence.model.UserIdCard;
import net.uhuijia.user.useridcard.persistence.model.UserIdCardExample;


@Service
@Transactional
public class UserIdCardServiceImpl
     extends CrudService<UserIdCardDao,UserIdCard,UserIdCardExample> implements UserIdCardService{
    @Autowired
    private UserIdCardDao userIdCardDao;


    /**
     * @Author xzj
     * @Description //添加用户身份证信息
     * @Date  2018/10/7
     * @Param
     * @return
     **/
    @Override
    public String addUserIdCard(UserMall userMall, String realName,String idCardFrontImg, String idCardBackImg) {
        UserIdCard userIdCard = new UserIdCard();
        userIdCard.setIdBackImg(idCardBackImg);
        userIdCard.setIdFrontImg(idCardFrontImg);
        userIdCard.setIdName(realName);
        userIdCard.setNickName(userIdCard.getNickName());
        userIdCard.setUserId(userMall.getId());
        return this.add(userIdCard);
    }
}